Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI workloads and enhance error handling #782

Merged
merged 1 commit into from
Apr 3, 2020

Conversation

aklenik
Copy link
Contributor

@aklenik aklenik commented Apr 1, 2020

Signed-off-by: Attila Klenik [email protected]

  • The bcType => getType() fix is applied to the Ethereum and Besu CI workload modules.
  • The TX and unexpected errors are separated in the Ethereum adapter. The latter now halt and fails the benchmark.
  • Worker-side errors are now reported with a stack trace in the logs.
  • Sawtooth adapter bug fixed, referenced non-existing instance variable.

Copy link
Contributor

@nklincoln nklincoln left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the one suggestion for edit 👍

@@ -365,7 +365,7 @@ class Sawtooth extends BlockchainInterface {
* @return {Promise} The return promise.
*/
getContext(name, args) {
let config = require(this.configPath);
let config = require(configPath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one kinda makes me itchy. I think the better solution here would be to set the config inside the Sawtooth constructor, and move the functions into the class so that they have access to a this.config property. Moreover, this would remove dynamic requires in the "hot path" during invokeSmartContract

@nklincoln nklincoln added the PR/change requested The PR is blocked until the requested changes are applied label Apr 2, 2020
@aklenik
Copy link
Contributor Author

aklenik commented Apr 2, 2020

@nklincoln I decided to make the config object a global variable, just like the configPath was. It was easier than refactoring the entire adapter 😅
@shemnon @benjamincburns Please double check that I correctly merged your previous PR, because I made some structural changes in the TX send function.

@benjamincburns
Copy link
Contributor

benjamincburns commented Apr 2, 2020

@nklincoln I decided to make the config object a global variable, just like the configPath was. It was easier than refactoring the entire adapter 😅
@shemnon @benjamincburns Please double check that I correctly merged your previous PR, because I made some structural changes in the TX send function.

@aklenik It looks like these changes incorporate my work from #780 correctly.

Does making the config object a module-scoped var in the sawtooth adapter hurt testability? I'm not too familiar with the code here, but I can imagine it impacting the ability to do concurrent unit tests, for example.

@aklenik
Copy link
Contributor Author

aklenik commented Apr 2, 2020

Does making the config object a module-scoped var in the sawtooth adapter hurt testability? I'm not too familiar with the code here, but I can imagine it impacting the ability to do concurrent unit tests, for example.

@benjamincburns You are right, the structure of the module could be improved (by making it more OO). It should be a trivial refactoring, but currently, most of our efforts go into cleaning up and enhancing the core code, and not the adapters (yet). But feel free to refactor it if you have some extra free time :) Although, working on the Ethereum/Besu adapter is probably more useful based on the community activity.

@nklincoln
Copy link
Contributor

ok, I'll raise a separate issue to refactor the sawtooth adaptor 👍

@nklincoln nklincoln merged commit d559eaa into hyperledger-caliper:master Apr 3, 2020
@shemnon
Copy link
Contributor

shemnon commented Apr 3, 2020

Also, while in sawtooth code you missed a couple of .bcType->.getType() changes, one in query.js and one in smallbankoperation.js

@aklenik aklenik deleted the adapter-fixes branch April 6, 2020 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR/change requested The PR is blocked until the requested changes are applied
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants